home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
T-TPUG Old Monthly Disks
/
(c)t8.d64
/
etch a sketch.c
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
1KB
|
42 lines
2 PRINT"[147]":FORS=1TO5:PRINT:NEXT:PRINTTAB(10)"ETCH-A-SKETCH":PRINTTAB(10)"-------------":PRINT:PRINT:PRINT
4 PRINT"YOU START AT THE UPPER LEFT CORNER.":PRINT"THE COMMANDS ARE:":PRINT
6 PRINT"E [206][205]","R [208]":PRINT:PRINT"D >","C [186]":PRINT:PRINT"X [205][206]","Z [204]":PRINT:PRINT"S _","W [207]":PRINT:PRINT"* CLR SCREEN"
8 PRINT: INPUT"PRESS RETURN";S$
10 BASE=2*4096:POKE53272,PEEK(53272)OR8:POKE53265,PEEK(53265)OR32
20 FORI=BASETOBASE+7999:POKEI,0:NEXT:FORI=1024TO2023:POKEI,3:NEXT:X=0:BIT=7:UP=7
30 IFPEEK(203)=14THENX=X-1:GOTO 100
35 IFPEEK(203)=17THENX=X-1:BIT=BIT-1:GOTO 110
40 IFPEEK(203)=18THENBIT=BIT-1:GOTO 120
45 IFPEEK(203)=20THENX=X+1:BIT=BIT-1:GOTO 130
50 IFPEEK(203)=23THENX=X+1:GOTO 140
55 IFPEEK(203)=12THENX=X+1:BIT=BIT+1:GOTO 150
60 IFPEEK(203)=13THENBIT=BIT+1:GOTO160
65 IFPEEK(203)=9THENX=X-1:BIT=BIT+1:GOTO 170
67 IFPEEK(203)=49THENGOTO10
70 GOTO30
80 A=PEEK(BASE+X)+(2^BIT)
81 IFPEEK(X+BASE)=255THENA=255
82 IFA>255THENA=128
83 POKEX+BASE,A
85 GOTO30
100 UP=UP+1:IFUP>7THENX=X-312:UP=0:GOTO80
105 GOTO80
110 UP=UP+1:IFUP>7THENX=X-312:UP=0
115 IFBIT<0 THENX=X+8:BIT=7:GOTO80
117 GOTO80
120 IFBIT<0 THENX=X+8:BIT=7:GOTO80
125 GOTO80
130 UP=UP-1:IFUP<0 THENX=X+312:UP=7
135 IFBIT<0 THENX=X+8:BIT=7:GOTO80
137 GOTO80
140 UP=UP-1:IFUP<0THENX=X+312:UP=7
143 GOTO80
150 UP=UP-1:IFUP<0THENX=X+312:UP=7
155 IFBIT>7THENX=X-8:BIT=0
157 GOTO80
160 IFBIT>7THENX=X-8:BIT=0
165 GOTO80
170 UP=UP+1:IFUP>7THENX=X-312:UP=0
175 IFBIT>7THENX=X-8:BIT=0
177 GOTO80